import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "DBshop010_销售管理退货处理退货"

firefox=openBrowser(url)

firefox.get(urlAdmin)

DBshopLoginAdmin(firefox)

DBshopEnterMenu2(firefox,'销售管理','退货管理')

firefox.find_element_by_xpath('//option[text()="退款到账户余额"]').click()

firefox.find_element_by_xpath('//option[text()="等待处理"]').click()

firefox.find_element_by_xpath('//button[@type="submit"]').click()

firefox.find_element_by_link_text('处理退货').click()

firefox.find_element_by_xpath('//option[text()="同意退货"]').click()

firefox.find_element_by_xpath('//button[@type="submit"]').click()

try:
    firefox.find_element_by_link_text("返回")

    writeLog("%s 测试通过" % testCase)
except:
    writeLog("%s 测试失败" % testCase)

    getPhoto(firefox)
firefox.quit()